package base

import (
	"fmt"
	"math/rand"
	"strconv"
	"time"
)

func GetUuid() string {
	now := time.Now()
	prefix := strconv.FormatInt(now.UnixMilli(), 36)
	after := strconv.FormatInt(int64(rand.Intn(100000)), 36)
	return fmt.Sprintf("%sA%04s", prefix, after)
}

func GetYYMM(t time.Time) string {
	return t.Format("200601")
}

func TimeFormat(t time.Time) string {
	return t.Format("2006-01-02/15:04:05")
}

func TimeYYYYMM(t time.Time) string {
	return t.Format("2006-01-02")
}
